<?php
$dirs=array(
	'a/tmp/f',
	'a/class/uu'
);
foreach($dirs as $d)
	is_dir($d) or mkdir($d,0755,true);

touch('a/tmp/a.txt');
touch('a/1.txt');
touch('a/tmp/f/aaa.doc');